package com.erlang4j.api.process;

import com.erlang4j.api.exceptions.Erlang4jCannotChangeStateToIllegalStateException;
import com.erlang4j.api.exceptions.Erlang4jCannotChangeStateTwiceException;

/**
 * This is a process that allows you to change the state of the underlying state machine. If you don't have any legal
 * states (for example you called spawn on {@link IElang4j} this will throw exceptions when called
 */
public interface IProcessWithState extends IProcess {
	/** Change the state to a new state. The state must be a legal name, or an exception will be thrown. */
	void changeState(String newStateName) throws Erlang4jCannotChangeStateToIllegalStateException, Erlang4jCannotChangeStateTwiceException;
}
